package NvWa_SimpleFactory_01.Factory;
import NvWa_SimpleFactory_01.Impl.Robot;
import NvWa_SimpleFactory_01.Impl.Man;
import NvWa_SimpleFactory_01.Impl.Woman;

public class NvWaFactory {
    public static void createHuman(String type) {
        if (type.equals("M")) {
            System.out.println("Creating a Man");
            Man man = new Man();
            man.show();
            man.eat();
            man.sleep();
            man.work();
        } else if (type.equals("W")) {
            System.out.println("Creating a Woman");
            Woman woman = new Woman();
            woman.show();
            woman.eat();
            woman.sleep();
            woman.work();
        } else if (type.equals("R")) {
            System.out.println("Creating a Robot");
            Robot robot = new Robot();
            robot.show();
            robot.eat();
            robot.sleep();
            robot.work();
        }
        else {
            System.out.println("I can't create " + type);
        }
    }
}
